package com.aier.user.service;

import java.util.List;

import java.util.Map;

import com.aier.user.entity.Dynamic;
import com.aier.user.entity.DynamicCR;
import com.aier.user.entity.User;



public interface IDynamicService {
    
    /**
     * 发布动态
     * @param uid
     * @param sid
     * @param cid
     * @param content
     * @param img
     * @param type
     * @return
     */
    int insertDynamic(Long uid,Integer sid,Long cid, String content,String img,Short type);
    
    /**
     * 转发动态
     * @param uid
     * @param sid
     * @param cid
     * @param content
     * @param did
     * @param type
     * @return
     */
    int insertOtherDynamic(Long uid,Integer sid,Long cid,String content,Long did,Short type);
    
    /**
     * 根据id查询动态
     * @param did
     * @return
     */
    Dynamic searchDynamic(Long did);
    
    /**
     * 评论动态
     * @param uid
     * @param fid
     * @param content
     * @return
     */
    int insertDynamicComment(Long uid,Long did,String content);
    
    /**
     * 回复动态评论
     * @param uid
     * @param dcid
     * @param rname
     * @param content
     * @return
     */
    int insertDCR(Long uid,Long dcid,String rname,String content);
    
    /**
     * 赞或取消赞动态
     * @param uid
     * @param did
     * @param ptype
     * @return
     */
    int updateDynamicPraise(Long uid,Long did,int ptype);
    
    /**
     * 获取学校、班级、个人动态 
     * @param page
     * @param pagesize
     * @param uid
     * @param cid
     * @param sid
     * @return
     */
    Map<String,Object> searchAllDynamic(int page,int pagesize,Long uid,Long cid,Integer sid);
    
    /**
     * 查询此用户是否赞过某条动态
     * @param uid
     * @param did
     * @return
     */
    int searchPraiseBySelf(Long uid, Long did);
    
    /**
     *  查询某一条动态的评论
     * @param page
     * @param pagesize
     * @param did
     * @return
     */
    Map<String,Object> searchCommentByDid(int page,int pagesize,Long did);
    
    /**
     * 获取动态评论的回复列表
     * @param dcid
     * @return
     */
    List<DynamicCR> searchCRByDcid(Long dcid);
    
    /**
     * 删除动态
     * @param did
     * @return
     */
    int deleteDynamic(Long did);
    
    /**
     * 删除评论
     * @param dcid
     * @return
     */
    int deleteComment(Long dcid);
    
    /**
     * 删除回复
     * @param dcrid
     * @return
     */
    int deleteReply(Long dcrid);
    
    /**
     * 获取某条动态的赞的人
     * @param did
     * @return
     */
    List<User> searchDynamicPraise(Long did);
    
    /**
     * 获取某条动态的详情
     * @param did
     * @return
     */
    Dynamic searchDynamicDetail(Long uid,Long did);
    
    /**
     * 获取与我相关的动态信息
     * @param page
     * @param pagesize
     * @param uid
     * @return
     */
    Map<String,Object> searchDynamicMessage(int page,int pagesize,Long uid);
    
    /**
     * 获取学校最新动态 
     * @param uid
     * @param cid
     * @param sid
     * @return
     */
    Dynamic searchDynamic(Integer sid);
    
}
